# Scrapy settings for heroSpider project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
#     https://docs.scrapy.org/en/latest/topics/settings.html
#     https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
#     https://docs.scrapy.org/en/latest/topics/spider-middleware.html

BOT_NAME = 'heroSpider'

SPIDER_MODULES = ['heroSpider.spiders']
NEWSPIDER_MODULE = 'heroSpider.spiders'


# Crawl responsibly by identifying yourself (and your website) on the user-agent
USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36 Aoyou/QGFyQFtmaVdpPUB7IT5SRDqBQup5RuGrW5IUOdfNP9irXly817H2kbaM'

# Obey robots.txt rules
# ROBOTSTXT_OBEY = True

# Configure maximum concurrent requests performed by Scrapy (default: 16)
#CONCURRENT_REQUESTS = 32

# Configure a delay for requests for the same website (default: 0)
# See https://docs.scrapy.org/en/latest/topics/settings.html#download-delay
# See also autothrottle settings and docs
DOWNLOAD_DELAY = 1
# The download delay setting will honor only one of:
CONCURRENT_REQUESTS_PER_DOMAIN = 16
#CONCURRENT_REQUESTS_PER_IP = 16

# Disable cookies (enabled by default)
# COOKIES_ENABLED = True

# Disable Telnet Console (enabled by default)
#TELNETCONSOLE_ENABLED = False

# Override the default request headers:
DEFAULT_REQUEST_HEADERS = {
  'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
  'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-TW;q=0.6',
  # 'Cookie':'WikiaLifetimeSource=https://www.google.com/; Geo={"region":"ZJ","country":"CN","continent":"AS"}; WikiaSessionSource=https://www.google.com/; tracking-opt-in-status=accepted; tracking-opt-in-version=4; _b2=0zfnkpkoki.1650287081066; wikia_beacon_id=4t3bo7gd4g; wikia_session_id=yuue081qpw; euconsent-v2=CPXpdM6PXpdM6CNAEAENCLCsAP_AAH_AACiQIPpB7TrNbSFD-e59dLs0MQxHR0CEYyQiAASBAmABQAKQAKwCgkAZBASABAgCIAAAIAJBAAAECAAACUAAQAAAAAFAAAAABQAIIAIAgAIQAgAIAAAABIEAEAAIgAQAEgAB0ggIAIIACAQAhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgfqACIKkxAAUJY4Ek0KRQgABBGAARAIAIAAIECIAAAABAArAIQQAkAAAAACAAAAAAgBgEAAAgACAAAQAFAAAAAAAAAAAAAAAgAAgAAAAAAAAAAAAAEgAAAAAAABAAAAAGBAEAAAAAIAAAAAAAgAAAAAAEAAAAAAAAAAAAAAAAAACAA.YAAAAAAAAAAA; tracking_session_id=3b6aceaf-f7f7-4012-b39f-07dc3e6b22c7; _gid=GA1.2.1038941146.1650287084; ae3_basset={"icStickySlotLineItemIds-0":{"name":"icStickySlotLineItemIds-0","result":true,"withCookie":true,"group":"B","limit":100}}; 3b6aceaf-f7f7-4012-b39f-07dc3e6b22c7_basset={"icStickySlotLineItemIds-0":{"name":"icStickySlotLineItemIds-0","result":true,"withCookie":true,"group":"B","limit":100}}; fandom_global_id=cc8eb5f7-9b14-4ec4-93cc-fcab56c5ec57; optimizelyEndUserId=oeu1650287123483r0.011270800039417717; _delighted_web={"walMwZAxr1ygqyqd":{"_delighted_fst":{"t":"1650287130668"}}}; pv_number_global=5; pv_number=5; last_known_wiki=https://mightyparty.fandom.com/wiki/Heroes; _ga_LVKNCJXRLW=GS1.1.1650287085.1.1.1650288367.0; _ga=GA1.1.981331596.1609965269'
}

# Enable or disable spider middlewares
# See https://docs.scrapy.org/en/latest/topics/spider-middleware.html
#SPIDER_MIDDLEWARES = {
#    'heroSpider.middlewares.HerospiderSpiderMiddleware': 543,
#}

# Enable or disable downloader middlewares
# See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html
#DOWNLOADER_MIDDLEWARES = {
#    'heroSpider.middlewares.HerospiderDownloaderMiddleware': 543,
#}

# Enable or disable extensions
# See https://docs.scrapy.org/en/latest/topics/extensions.html
#EXTENSIONS = {
#    'scrapy.extensions.telnet.TelnetConsole': None,
#}

# Configure item pipelines
# See https://docs.scrapy.org/en/latest/topics/item-pipeline.html
ITEM_PIPELINES = {
   'heroSpider.pipelines.HerospiderPipeline': 300,
}

# Enable and configure the AutoThrottle extension (disabled by default)
# See https://docs.scrapy.org/en/latest/topics/autothrottle.html
#AUTOTHROTTLE_ENABLED = True
# The initial download delay
#AUTOTHROTTLE_START_DELAY = 5
# The maximum download delay to be set in case of high latencies
#AUTOTHROTTLE_MAX_DELAY = 60
# The average number of requests Scrapy should be sending in parallel to
# each remote server
#AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
# Enable showing throttling stats for every response received:
#AUTOTHROTTLE_DEBUG = False

# Enable and configure HTTP caching (disabled by default)
# See https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
#HTTPCACHE_ENABLED = True
#HTTPCACHE_EXPIRATION_SECS = 0
#HTTPCACHE_DIR = 'httpcache'
#HTTPCACHE_IGNORE_HTTP_CODES = []
#HTTPCACHE_STORAGE = 'scrapy.extensions.httpcache.FilesystemCacheStorage'
